import sys
from PyQt4 import QtGui

class Example(QtGui.QMainWindow):
	def __init__(self):
		super(Example, self).__init__()
		self.initUI()
	def initUI(self):
		eact = QtGui.QAction(QtGui.QIcon('exit.png'),'&exit',self)
	tact = QtGui.QAction(QtGui.QIcon('exit.png'),'&treta',self)
	eact.srtShortcut('Ctrl+Q')
	eact.setStatusTip('Exit Aplication')
	eact.triggered.connect(QtGui.qApp.quit)
	tact.triggered.connect(treta)
	self.statusBar()
	mb=self.menuBar()
	fm= mb.addMenu('&file')
	fm.addAction(tact)
	fm.addAction(eact)
	self.setGeometry(300,300,300,200)
	self.setWindowTitle('Menubar')
	self.show()
	
def treta():
	print "treta"
		
def main():
	app=QtGui.QApplication(sys.argv)
	ex= Example()
	sys.exit(app.exec_())

if __name__=='__main__':
	main()
